import VuiElement from '../base/element';
import { createInput } from '../dom';

export default class VuiCheckbox extends VuiElement {
  constructor(config) {
    super();
    const defaultConfig = {
      id: '',
      className: '',
      value: '',
      name: '',
      type: 'checkbox',
      readOnly: ''
    };
    this._config = Object.assign(defaultConfig, config);
  }

  initUI() {
    this.container = createInput(this._config);
  }

  setChecked(value) {
    this.container.checked = value;
  }

  getChecked() {
    return this.container.checked;
  }
}
